
import 'package:flutter/material.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x00_aleret_item.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x01_alert_dialog_routes.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x05_checking_dialog_routes.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x04_custom_dialog_routes.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x03_list_dialog_routes.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x02_simple_dialog_routes.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x06_bottom_sheet_routes.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x07_loading_route.dart';
import 'package:flutter_demo/start_up/function_widgets/alerts/0x08_date_picker_route.dart';
import 'alerts/0x01_alert_dialog_routes.dart';

class _AlertItem extends AlertItem {
  _AlertItem(String text, Widget page, BuildContext context) : super(text, () {
    Navigator.push(context, MaterialPageRoute(builder: (context) => page));
  });
}

class AlertsPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Alerts"),
      ),
      body: Padding(
        padding: EdgeInsets.only(
          top: 18,
          bottom: 18
        ),
        child: ListView(
          children: <Widget>[
            _AlertItem("Alert Dialogs", AlertDialogPage(), context),
            _AlertItem("Simple Dialogs", SimpleDialogPage(), context),
            _AlertItem("List Alert", ListDialogPage(), context),
            _AlertItem("Custom Dialog", CustomDialogPage(), context),
            _AlertItem("Checking Dialog", CheckingDialogPage(), context),
            _AlertItem("Bottom Sheet", BottomSheetsPage(), context),
            _AlertItem("Loading", LoadingPage(), context),
            _AlertItem("Date Picker", DatePickerPage(), context),
          ],
        ),
      )
    );
  }

}

